package com.travel.modules.asset.controller;

import com.travel.commons.utils.R;
import com.travel.modules.asset.service.AdvertiseService;
import com.travel.modules.asset.service.RouteService;
import com.travel.modules.asset.service.HotelService;
import com.travel.modules.asset.service.ScenicAreaService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/static/home")
public class HomeController {
    @Resource
    private ScenicAreaService scenicAreaService;

    @Resource
    private HotelService hotelService;

    @Resource
    private RouteService routeService;

    @Resource
    private AdvertiseService advertiseService;

    /**
     * 获取广告
     */
    @RequestMapping("/ad")
    private R advertise() {
        return R.ok().put("page", advertiseService.getAds());
    }

    /**
     * 获取火热景点
     */
    @RequestMapping("/scenic")
    public R scenic() {
        return R.ok().put("page", scenicAreaService.hotScenicAreas());
    }

    /**
     * 获取火热路线
     */
    @RequestMapping("/goods")
    public R goods() {
        return R.ok().put("page", routeService.hotGoods());
    }

    /**
     * 获取火热酒店/旅馆
     */
    @RequestMapping("/hotel")
    public R hotel() {
        return R.ok().put("page", hotelService.hotHotels());
    }
}
